	<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

	<head>
		<meta charset="utf-8"/>
		<title>表单</title>
		<meta name="renderer" content="webkit"/>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
		<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
		<meta name="apple-mobile-web-app-capable" content="yes"/>
		<meta name="format-detection" content="telephone=no"/>

		<link rel="stylesheet" href="/layui/plugins/layui/css/layui.css" media="all" />
		<script src="/main/js/jquery.min.js"></script>
        <script src="/main/js/template-web.js"></script>
        <script src="/layui/plugins/layui/layui.js"></script>
    </head>

	<body>

    <input type="hidden" id="user2" th:value="${session.user}"/>
		<div style="margin: 15px;">
			<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
				<legend>更改头像</legend>
			</fieldset>

			<form class="layui-form" action="" style="height: 100%" >

				<div class="layui-form-item">
					<div class="layui-input-block">
						<img width="50" height="50"  src="/images/avatar.jpg"/>
						<input type="radio" name="pic" value="/images/avatar.jpg" title="头像一"/>
						<img width="50" height="50" src="/images/head1.jpg"/>
						<input type="radio" name="pic" value="/images/head1.jpg" title="头像二"/>
						<img width="50" height="50" src="/images/head2.jpg"/>
						<input type="radio" name="pic" value="/images/head2.jpg" title="头像三"/>
                    </div>
                    <div class="layui-input-block">
						<img width="50" height="50" src="/images/head3.jpg"/>
						<input type="radio" name="pic" value="/images/head3.jpg" title="头像四"/>
						<img width="50" height="50" src="/images/head4.jpg"/>
                        <input type="radio" name="pic" value="/images/head4.jpg" title="头像五"/>
                    </div>


				</div>


                <p> &nbsp;</p>

				<div class="layui-form-item">
					<div class="layui-input-block">
						<button class="layui-btn" lay-submit="" lay-filter="demo1">提交更改</button>
						<button type="reset" class="layui-btn layui-btn-primary">重置</button>
					</div>
				</div>
			</form>
		</div>
		<script>


			layui.use(['form', 'layedit', 'laydate','upload'], function() {
				var form = layui.form,
					layer = layui.layer

				//监听提交
				form.on('submit(demo1)', function(data) {
                    Final =JSON.stringify(data.field);
                      // alert(data.field.pic);
					var user2 = document.getElementById("user2").value;

                    var imgSrc = parent.document.getElementById('test1');
                    imgSrc.src = data.field.pic;
					parent.document.getElementById("imgMes").value = data.field.pic;

					layer.close(parent.index);
					return false;
				});
			});
		</script>
	</body>

</html>